package com.warehouse.util;


import org.apache.commons.lang3.RandomStringUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 订单工具类
 * @author 卓汉杰
 * */
public class OrderTDGenertorUtile {


    /**
     * 生成订单号
     * */
    public static String getOrderNumber(Integer id){
        Date date = new Date();
        SimpleDateFormat sd = new SimpleDateFormat("MMddssSSS");
        String nowTime = sd.format(date);
        String s = RandomStringUtils.randomNumeric(4);
        return s+nowTime+id;

    }

    public static void main(String[] args) {
        int i = 0;
        while (i<=1000000000){
            System.out.println(getOrderNumber(i++));
        }
    }
}
